<?php

/*
 * Copyright 2015 jiaojie <jiaojie1989@gmail.com>.
 * 
 * Check your synatx if it is right.
 * Check your variables if the names are just correct.
 * Finally, run it under your command line.
 * Enjoy it!
 */

namespace Ziroom\Util\Redis;

//use Redis;
use RedisException;
use Ziroom\Util\Redis\Client;

/**
 * Redis Signgleton
 * @author jiaojie <jiaojie1989@gmail.com>
 * @date 2015-4-15
 * @version 1.0.0
 * @description
 */
class Singleton {

    /**
     *
     * @var Ziroom\Util\Redis\Client 
     */
    protected static $redisClient;

    protected function __construct() {
        
    }

    protected function __clone() {
        
    }

    public static function getInstance() {
        try {
            if (!static::$redisClient instanceof Client) {
                static::$redisClient = Client::getInstance();
            }
            return static::$redisClient;
        } catch (RedisException $e) {
            return false;
        }
    }

}
